/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package mp.weixin.WXpublic.send;

import mp.weixin.WXpublic.BaseReceiveMessage;
import mp.weixin.WXpublic.BaseSendMessage;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;

/**
 *
 * @author aolin
 */
public class SCustomerService extends BaseSendMessage {

    public SCustomerService(BaseReceiveMessage brm) {
        super(brm);
    }

    @Override
    public SendTypeEnum getMsgType() {
        return BaseSendMessage.SendTypeEnum.TRANSFER_CUSTOMER_SERVICE;
    }

    @Override
    public String toWeiXinMessageXMLString() {
        Document doc = DocumentHelper.createDocument();
        Element rootXML = doc.addElement("xml");
        rootXML.addElement("ToUserName").setText(this.getToUserName());
        rootXML.addElement("FromUserName").setText(this.getFromUserName());
        rootXML.addElement("CreateTime").setText(this.getCreateTime().getTime() + "");
        rootXML.addElement("MsgType").setText(this.getMsgType().getType());
        String returnStr = rootXML.asXML();
        return returnStr;
    }

}
